#include <iostream>
#include <vector>

using namespace std;

class Solution {
public:
  void reverse(vector<int> &nums, int left, int right) {
    int tmp;
    while (left < right) {
      tmp = nums[left];
      nums[left] = nums[right];
      nums[right] = tmp;
      left++;
      right--;
    }
  }
  void rotate(vector<int> &nums, int k) {
    // cache k
    // reverse left, reverse right, reverse whole
    int length = nums.size();

    if (length == 0) {
      return;
    }

    int rotate_num = k % length;

    reverse(nums, 0, length - rotate_num - 1);
    reverse(nums, length - rotate_num, length - 1);
    reverse(nums, 0, length - 1);
  }
};

int main() { return 0; }
